﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace YFrameWork.RunTime
{
    /// <summary>
    /// 资源加载组件
    /// </summary>
    public class ResourceComponent : YFrameWorkComponent
    {
        public IResourceManager resource;
   

        public override void ToCreate()
        {
            resource = new ResourceManager();
        }

        public void DestoryResourceItem(ResourceItem item, bool destoryCache = false)
        {
            resource.DestoryResourceItem(item,destoryCache);
        }

        public T LoadResource<T>(string path) where T : Object
        {
            return resource.LoadResource<T>(path);
        }
        public bool ReleaseResource(ResourceItem item, bool destoryObj = false)
        {
            return resource.ReleaseResource(item, destoryObj);
        }

        public bool ReleaseResource(Object obj, bool destoryObj = false)
        {
            return resource.ReleaseResource(obj, destoryObj);
        }
    }
}